<!--
 * @Author: hucc
 * @Date: 2021-10-15 14:42:04
 * @LastEditors: hucc
 * @LastEditTime: 2021-10-16 20:30:36
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/qs.js"></script>
    <script src="../js/jquery.js"></script>
    <script>
        const qs = Qs;
        const baseUrl = "http://39.103.202.53:8888"
        const queryData = {
            page: 1,
            pageSize: 10
        }
        const loginData = {
                username: 'admin1',
                password: 123321
            }
            //get方式  不带参数
        $.ajax({
                url: baseUrl + '/index/category/findAll',
                method: 'get',
                success(res) {
                    console.log(res)
                },
                error(err) {
                    console.log(err);
                }
            })
            //jquery中post请求头格式 Content-type默认是表单格式
            //post传递json数据格式 要配置headers请求头 和data数据
        $.ajax({
            url: baseUrl + '/user/login',
            method: 'post',
            headers: {
                'Content-type': 'application/json'
            },
            data: JSON.stringify(loginData),
            success(res) {
                console.log(res);
            },
            error(err) {
                console.log(err);
            }
        })
    </script>
</head>

<body>

</body>

</html>